<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<%@ page import="net.sf.rose.jdbc.service.DataBaseFactory" %>
<c:set var="path" value="..${ctx}/define/database"/>


<div class="pageContent">
<form method="post" action="${path}/datasource.html" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone2);" >
	<div class="pageFormContent">
		<%
		java.util.List<String> list = DataBaseFactory.getProperties().getList();
		StringBuffer buf = new StringBuffer();
		for(Object key : list){
			buf.append(key).append("\r\n");
		}
		%>
		<textarea rows="15" cols="80" name="properties"><%=buf.toString()%></textarea>
	</div>

	<div class="formBar">
		<ul>
			<li><div class="button"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
			<li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li>
		</ul>
	</div>
</form>
</div>
<script type="text/javascript">
/**
 * dialog上的表单提交回调函数
 * 服务器转回navTabId，可以重新载入指定的navTab. statusCode=DWZ.statusCode.ok表示操作成功, 自动关闭当前dialog
 * form提交后返回json数据结构,json格式和navTabAjaxDone一致
 */
function dialogAjaxDone2(json){
	DWZ.ajaxDone(json);
	if (json.statusCode == DWZ.statusCode.ok){
		// alert(json.callbackType);
		if(json.callbackType){
			// navTab.reload("${path}/search.html");//刷新
			setTimeout(function(){$.pdialog.closeCurrent();}, 100);
		}
	}
}
</script>
